package com.qisimanxiang.dalaran.zuul.hystrix;

import com.netflix.hystrix.HystrixCommandKey;
import com.netflix.hystrix.HystrixCommandProperties;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategyDefault;

/**
 * @author wangmeng
 * @date created in 3:33 下午 2019/9/17
 * @modified by
 */
public class HystrixPropertiesStrategyCustom extends HystrixPropertiesStrategy {
    private final static HystrixPropertiesStrategyCustom INSTANCE = new HystrixPropertiesStrategyCustom();

    private HystrixPropertiesStrategyCustom() {
    }

    public static HystrixPropertiesStrategy getInstance() {
        return INSTANCE;
    }

    @Override
    public HystrixCommandProperties getCommandProperties(HystrixCommandKey commandKey, HystrixCommandProperties.Setter builder) {
        builder.withCircuitBreakerEnabled(false);
//        builder.withCircuitBreakerForceClosed(true);
        return super.getCommandProperties(commandKey, builder);
    }
}
